//
//  AdView.m
//  MilitaryDemo
//
//  Created by qianfeng01 on 15-7-4.
//  Copyright (c) 2015年 qianfeng01. All rights reserved.
//

#import "AdView.h"
#import "UIImageView+WebCache.h"
#import "NewsDetailViewController.h"
@implementation AdView


-(void)setImageNames:(NSMutableArray *)imageNames{
    for (int i=0; i<imageNames.count; i++) {
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i*kScreenSize.width, 0, kScreenSize.width, kScreenSize.height/4)];
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageNames[i]]placeholderImage:[UIImage imageNamed:@"zhanwei"]];

        [self addSubview:self.imageView];
    }
    self.pagingEnabled = YES;
    self.contentSize = CGSizeMake(kScreenSize.width*imageNames.count, kScreenSize.height/4);

   }

-(void)setTextArr:(NSMutableArray *)textArr 
{
    for (int i=0; i<textArr.count; i++) {
        UILabel *label=[[UILabel alloc]initWithFrame:CGRectMake(i*kScreenSize.width+5, kScreenSize.height/4-30, kScreenSize.width, 30)];
        label.textAlignment=NSTextAlignmentLeft;
        label.backgroundColor=[UIColor clearColor];
        label.text=textArr[i];
        label.backgroundColor=[UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.1];;
        label.font=[UIFont boldSystemFontOfSize:13.0];
        label.textColor=[UIColor whiteColor];
        [self addSubview:label];
    }
    
}
@end
